package com.lzy.cloud.ticket.train.servcie.impl;

import com.lzy.cloud.ticket.train.dtos.TrainChangsDto;
import com.lzy.cloud.ticket.train.entity.TrainChangs;
import com.lzy.cloud.ticket.train.mapper.TrainChangsMapperExt;
import com.lzy.cloud.ticket.train.servcie.TrainChangsService;
import com.lzy.framework.core.utils.DozerUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by WIN7 on 2018/6/5.
 */
@Service
public class TrainChangsServiceImpl implements TrainChangsService {

    @Autowired
    private TrainChangsMapperExt trainChangsMapperExt;

    @Override
    public TrainChangsDto queryTrainChangesByCondition(TrainChangsDto trainChangsDto) {
        return trainChangsMapperExt.queryTrainChangesByCondition(trainChangsDto);
    }

    @Override
    public boolean createTrainChangs(TrainChangsDto trainChangsDto) {
        return trainChangsMapperExt.insertSelective(DozerUtils.map(trainChangsDto, TrainChangs.class))>0;
    }
}
